Repository navigation
Conversation
A disabled knote stays registered and is not reported. A user trigger or vnode hint that arrives while it is disabled is kept and reported after EV_ENABLE, and a socket is polled again at the first scan after it. The state changes after the other changes of the same kevent, and EV_DELETE with EV_DISABLE deletes, as kqueue_register does with KN_DISABLED in FreeBSD 11. EV_DISABLE on EVFILT_TIMER still throws: enabling it again is a change to an existing timer, which is not supported.
|
Independent Linux validation of Ubuntu 26.04.1 x86-64, GCC 15.2.0, Release, bundled dependencies,
Initial socket sends returned EPERM under the Codex sandbox on both versions. The results above use host execution with local IPC permitted; no external service was contacted. Initial failure logs are retained as environment evidence. Expectations use the PR's pinned FreeBSD source. No console, title, extra Windows or complete CTest-suite run is claimed. Timer enable/disable remains outside the supported scope described in this PR. AI-assisted validation/report: Codex. Your existing patch is unchanged. |
|
Closing: no title is known to reach this. With the queue at 700+ open PRs, please hold off on new PRs that don't name a title needing the change until it's down. If a title stops on this on current main, reopen with the title ID and the log line. |
What
keventacceptsEV_DISABLEandEV_ENABLEinstead of throwing onEV_DISABLE.Semantics follow FreeBSD 11
kern_event.c, the revision the libkernel technical debt entry already pins:kqueue_register(done_ev_add):EV_ENABLEclearsKN_DISABLED, otherwiseEV_DISABLEsets it, after the other changes of the same kevent. It applies to a knote added by the same change and to an existing one.EV_DELETEis handled first, soEV_DELETE | EV_DISABLEdeletes.kqueue_scan: a disabled knote is not reported and stays registered.KNOTE_ACTIVATE: activity that arrives while a knote is disabled is kept, so it is reported afterEV_ENABLE.Implementation:
KernelEqueueEventgets adisabledflag, set when the knote is added (AddVnodeEventtakes it as a parameter so the knote is never visible enabled) and changed inModifyKnote.CollectOncePerWaitskips disabled knotes.PollEventsandWaitForDescriptorsskip them too, so a disabled socket that is readable does not wake the wait.EV_ENABLE.EV_DISABLEonEVFILT_TIMERstill throws: enabling it again is a change to an existing timer, which throws onmain.EV_DISPATCHandEV_FORCEONESHOTare unchanged. Not measured on a console.Tested
Windows 11, MinGW-w64 GCC 15.2.0 (WinLibs r7), full build with
BUILD_TESTING=ON.guest_kqueue: newDisabledEventscoversEV_ENABLE/EV_DISABLEon a missing knote (ENOENT), a user event added disabled then triggered and enabled, disabling and enabling an existing level event,EV_DELETE | EV_DISABLE, anEV_CLEARuser event touched while disabled, anEV_ONESHOTevent enabled from another thread whilekeventwaits, a readable socket added disabled (a 30 mskeventdoes not return early) then enabled, and a file watch added disabled whose write is reported afterEV_ENABLE. The assertion inErrorsthatEV_ADD | EV_DISABLEthrows now uses a timer.ctest -j 8, 1097 tests, 1090 passed, 0 failed, 7 skipped. The same 7 are skipped onmainon this machine (fivevideo_out_flip_*,agc_driver_stencil_ref_export,guest_video_out_wqhd_detection_no_vulkan).python tools/check_conventions.py --base origin/mainpasses.Linux: WSL2 Ubuntu 24.04 (kernel 6.6.87.2), GCC 13.3.0, lavapipe (Mesa 25.2.8), this branch merged into
main0aa4cb1c2as the CIlinuxjob does.guest_kqueuepasses. Full suite with the CI environment,ctest --parallel 8: 1080 tests, 2 failed, 48 skipped. Both failures also occur onmainalone in this environment, three runs out of three:agc_driver_depth_compare_copyneeds the write watch, which the WSL kernel lacks (no asynchronous userfaultfd write protection), andguest_socket_read_writegetsEAGAINwhere it expectsEPIPEat line 154.tools/check_skips.pyreports five of the skips as unexpected: four write-watch tests andguest_video_out_high_frame_rate(no 120 Hz display). No title or homebrew was run.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)EV_DISABLEorEV_ENABLE; fix(libkernel): answer fcntl status flags on libSceNet sockets #4924 changes the same files.